@echo off
set WORKING_DIRECTORY=%CD%
rem set NDK_HOME=F:\MyProjects\android-ndk-r9d

if "%1"=="core" (
	call %NDK_HOME%\ndk-build.cmd NDK_PROJECT_PATH=%WORKING_DIRECTORY%\aecore
	copy %WORKING_DIRECTORY%\aecore\obj\local\armeabi-v7a\libaecore.a %WORKING_DIRECTORY%\libs
)

if "%1"=="engine" (
	set NDK_MODULE_PATH=C:\MyProjects\AEngine\builds\android\aecore\
	call %NDK_HOME%\ndk-build.cmd NDK_PROJECT_PATH=%WORKING_DIRECTORY%\enginelib V=1
	copy %WORKING_DIRECTORY%\enginelib\obj\local\armeabi-v7a\libAEngine.so %WORKING_DIRECTORY%\libs
)

if "%1"=="" (
	call %NDK_HOME%\ndk-build.cmd NDK_PROJECT_PATH=%WORKING_DIRECTORY%\corelib
	copy %WORKING_DIRECTORY%\aecore\obj\local\armeabi-v7a\libAECore.a %WORKING_DIRECTORY%\libs
	call %NDK_HOME%\ndk-build.cmd NDK_PROJECT_PATH=%WORKING_DIRECTORY%\enginelib
	copy %WORKING_DIRECTORY%\enginelib\obj\local\armeabi-v7a\libAEngine.so %WORKING_DIRECTORY%\libs
)